public class GameRole {
    private String name;
    private int vit;
    private int def;


    public GameRole(String name, int vit, int def) {
        this.name = name;
        this.vit = vit;
        this.def = def;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getVit() {
        return vit;
    }

    public void setVit(int vit) {
        this.vit = vit;
    }

    public int getDef() {
        return def;
    }

    public void setDef(int def) {
        this.def = def;
    }

    public Memento createMemento() {
        return new Memento(this.vit,this.def);
    }

    public void backFromMemento(Memento memento){
        this.vit = memento.getVit();
        this.def = memento.getDef();
    }

    public void display(){
        System.out.println(name+":"+"攻击力"+vit+"--"+"防御力"+def);
    }
}
